//
//  YLNetMgr.h
//  DoulinClient
//
//  Created by YLKJ on 2019/2/27.
//

#import <Foundation/Foundation.h>
#import "YLReqest.h"

#pragma mark - ------------------ 发起请求 ------------------
@interface YLNetMgr : NSObject
/** 请求参数加密, 不用缓存, 使用此方法 */
+ (void)reqEncrypt:(YTKBaseRequest *)req
           success:(void(^)(YTKBaseRequest *req, NSDictionary *resDic))success
           failure:(void(^)(YTKBaseRequest *req))failure;
/** 请求参数加密, 使用缓存, 使用此方法 */
+ (void)reqCacheEncrypt:(YTKBaseRequest *)req
                success:(void(^)(YTKBaseRequest *req, NSDictionary *resDic))success
                failure:(void(^)(YTKBaseRequest *req))failure;
/** 请求参数未加密, 不用缓存, 使用此方法 */
+ (void)reqNoEncrypt:(YTKBaseRequest *)req
             success:(void(^)(YTKBaseRequest *req, NSDictionary *resDic))success
             failure:(void(^)(YTKBaseRequest *req))failure;

+(void)getWithUrl:(NSString *)requestUrl body:(NSMutableDictionary *)params success:(void(^)(NSDictionary *response))success failure:(void(^)(NSError *error))failur;

+ (void)postWithUrl:(NSString *)requestUrl body:(NSMutableDictionary *)params success:(void(^)(NSDictionary *response))success failure:(void(^)(NSError *error))failur;

@end

#pragma mark - ------------------ 解密 ------------------
@interface YLNetMgr (Decrypt)
+ (NSData *)decryptResponseObj:(id)responseObj;
@end

#pragma mark - ------------------ 弹窗 ------------------
@interface YLNetMgr (Alert)
+ (void)showNoNetAlert;
+ (void)showLoginAlert;
+ (void)hideAlert;
@end

#pragma mark - ------------------ 代理 ------------------
@interface YLNetMgr (Delegate)
+ (BOOL)detectiveHttpDelegate;
+(void)bodyWithParams:(NSMutableDictionary *)params;
@end


/** 错误码
 *  0: 数据正常
 *  1: 错误
 *  2: 登录失效
 *  3: 账户余额不足
 *  4: 手机号已绑定微信
 *  5: 手机号未绑定微信
 */
